package it.oneb.study.mysql;

import java.sql.ResultSet;
import java.sql.SQLException;

public class mysqlMain {

	public static void main(String[] args)
	{
		String jdbcUrl = "jdbc:mysql://localhost:3306/test?user=root&password=123456";
		String sql = "select * from user";
			
		DbConfig dbConfig = new DbConfig(jdbcUrl);
		dbConfig.openConnection();
		
		
		ResultSet resultSet = dbConfig.querySql(sql);
		try {
			while(resultSet.next()){
				System.out.println(resultSet.getString("NAME"));
			}
		} catch (SQLException e) {
			System.out.println(e.getMessage());
		}
		
		dbConfig.closeConnection();
	}
}
